<div class="user_form2">
	<div class="form_box">
		<div class="user_form_title">
			Mi cuenta
		</div>
		<div class="user_form_content">
			<div class="user_form_divisor" colspan="2">Datos de usuario</div>
			<div class="user_edit_form left">
				<?= Form::open('user/account', array('method' => 'POST'));?>
				<?= Form::hidden('form', 'userdata_form'); ?>
				<table>
					<tr>
						<td class="label_form"><?= Form::label('username', 'Usuario') ?></td>
						<td><?= Form::input('username', $user->username, array('disabled' => 'disabled')); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('email', 'Email') ?></td>
						<td><?= Form::input('email', $user->email, array('disabled' => 'disabled')); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('current_password', 'Contraseña actual') ?></td>
						<td><?= Form::password('current_password'); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('password', 'Nueva contraseña') ?></td>
						<td><?= Form::password('password'); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('confirm_password', 'Confirmar contraseña') ?></td>
						<td><?= Form::password('confirm_password'); ?></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<?
							if(!empty($userdata_errors)) {
							?>
							<div class="error_box">
								<div><?= $userdata_errors ?></div>
							</div>
							<?
							}
							?>
							<?
							if(!empty($userdata_success)) {
							?>
							<div class="success_box">
								<div><?= $userdata_success ?></div>
							</div>
							<?
							}
							?>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><?= Form::submit(NULL, "Cambiar contraseña"); ?></td>
					</tr>
				</table>
				<?= Form::close(); ?>
			</div>
			<div class="user_edit_explanation right">
			
			</div>
			<div class="clear"></div>
			
			
			<div class="user_form_divisor" colspan="2">Datos personales</div>
			<div class="user_edit_form left">	
				<?
				if(!empty($personal_errors)) {
				?>
				<div class="error_box">
				<?
				foreach($personal_errors as $message) {
				?> 
					<div><?= $message ?></div>
				<?
				}
				?>	
				</div>
				<?
				}
				?>
				<?= Form::open('user/account', array('method' => 'POST'));?>
				<?= Form::hidden('form', 'personaldata_form'); ?>
					
				<table>
					<tr>
						<td class="label_form"><?= Form::label('name', 'Nombre') ?></td>
						<td><?= Form::input('name', !is_null($userinfo) ? $userinfo->name : ""); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('lastname', 'Apellido') ?></td>
						<td><?= Form::input('lastname', !is_null($userinfo) ? $userinfo->lastname : ""); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('location', 'Localidad') ?></td>
						<td><?= Form::input('location', !is_null($userinfo) ? $userinfo->location : ""); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('province', 'Provincia') ?></td>
						<td><?= Form::select('province', $provinces, !is_null($userinfo) ? $userinfo->province_id : 0); ?></td>
					</tr>
					<tr>
						<td class="label_form"><?= Form::label('country', 'País') ?></td>
						<td><?= Form::input('country', "Argentina", array('disabled' => 'disabled')); ?></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<?
							if(!empty($personaldata_errors)) {
							?>
							<div class="error_box">
								<div><?= $personaldata_errors ?></div>
							</div>
							<?
							}
							?>
							<?
							if(!empty($personaldata_success)) {
							?>
							<div class="success_box">
								<div><?= $personaldata_success ?></div>
							</div>
							<?
							}
							?>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><?= Form::submit(NULL, "Guardar cambios"); ?></td>
					</tr>
					<?= Form::close(); ?>
				</table>
			</div>
			<div class="clear"></div>
		</div>
	</div>
</div>